package com.fp.m7.client.view;

import com.fp.m7.client.MyMessages;
import com.fp.m7.client.presenter.HomePresenter;
import com.fp.m7.client.widget.VerticalPanelWithEmptyView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasWidgets;
import com.google.gwt.user.client.ui.Label;

/**
 * This is supposed to display a random list of users.
 * 
 * @author 7
 */
public class HomeView extends Composite implements HomePresenter.Display {

    private static MyMessages msg = GWT.create(MyMessages.class);

    private VerticalPanelWithEmptyView randomUsersPanel;

    public HomeView() {
        AbsolutePanel panel = new AbsolutePanel();
        panel.setStyleName("fillBothDirections");
        initWidget(panel);
        panel.setSize("466px", "600px");

        Label home = new Label(msg.homeDescription());
        home.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
        home.setWordWrap(true);
        panel.add(home, 16, 16);
        home.setSize("434px", "48px");

        randomUsersPanel = new VerticalPanelWithEmptyView();
        panel.add(randomUsersPanel, 16, 73);
        randomUsersPanel.setSize("434px", "517px");
    }

    @Override
    public HasWidgets getContentPanel() {
        return randomUsersPanel;
    }

}
